<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        let str = '    东软睿道Java7班,东软睿道Java7班     ';
        // substring
        console.log(str.substring(1));
        console.log(str.substring(1,5));
        console.log(str.substring(5,1));

        // slice
        console.log(str.slice(1));
        console.log(str.slice(1,5));
        console.log(str.slice(5,1));

        // substr 起始索引,长度
        console.log(str.substr(1));
        console.log(str.substr(1,5));
        console.log(str.substr(5,1));

        // indexOf
        console.log(str.indexOf('a'));
        // charAt
        console.log(str.charAt(1));
        // split
        console.log(str.split(','));
        // trim
        console.log(str.trim());
    </script>
</body>
</html>